package com.dao;

import com.entity.KechengEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;

import org.apache.ibatis.annotations.Param;
import com.entity.view.KechengView;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 课程信息 Dao 接口
 *
 * @author 
 */
public interface KechengDao extends BaseMapper<KechengEntity> {

   List<KechengView> selectListView(Pagination page,@Param("params")Map<String,Object> params);


   @Update("<script> update kecheng set sign=#{params.sign} where id=#{params.rowid};</script>")
   int updateKechengSign(@Param("params")Map<String,Object> param);

   @Update("<script> insert  into kecheng_sign (kechengid,yonghuid) values (#{params.kechengid},#{params.yonghuId}+0);</script>")
   int insertKechengSignRecord(@Param("params")Map<String,Object> param);

   @Select("<script>select GROUP_CONCAT(yh.username SEPARATOR ',') from yonghu as yh where yh.id in ( select yonghuid from kecheng_sign where kechengid=#{params.kechengid});</script>")
   List<String> getUserNames(@Param("params")Map<String,Object> param) ;

}
